package com.ptswitch.material.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import com.ptswitch.material.model.material.BomMaterial;

public interface BomMaterialMapper {
    @Insert("insert into bomMaterial(bomId,code,comment,designator,footprint,materialId"//
            + ",quantity,stuffOpt,value,voltage)"//
            + " values(#{bm.bom.id},#{bm.code},#{bm.comment},#{bm.designator},"//
            + ",#{bm.footprint},#{bm.material.id},#{bm.quantity},#{bm.stuffOpt}"//
            + ",#{bm.value},#{bm.voltage}) returning id")
    long add(@Param("bm") BomMaterial bomMaterial);

    @Delete("delete from bomMaterial where id=#{bm.id}")
    void delete(@Param("bm") BomMaterial bomMaterial);
}
